
<%@ include file="/common/common.jsp"%>
<%@ page language="java" pageEncoding="UTF-8"%>
<head>
<!--添加弹层效果和layui-->
<script type="text/javascript" src="<%=jsPath%>/layer/layer.js"></script>

<script>
var index = parent.layer.getFrameIndex(window.name); //获取窗口索引

//初始化准备
$(document).ready(function(){
    //定义按钮点击事件
    $("#sendTextCommandBtn").click(function () {
        //获取文本
        var text = $("#textContent").val();
        //获取显示类型
        var displayOption= new Array();
        for (var i = 0; i < 5; i++) {
            if (i != 1) {
                if ($("#ckDisplay"+i).attr("checked") != undefined) {
                    displayOption.push($("#ckDisplay"+i).val());
                }
            }
        }
        if(text == ""){
            layer.msg("请输入下发内容");
            return;
        }
        if(displayOption.length == 0){
            layer.msg("请选择显示类型");
            return;
        }
        parent.$("#formParam1").val(text);
        // parent.$("#formParam1").attr("name","textContent");
        parent.$("#formParam2").val(displayOption);
        // parent.$("#formParam2").attr("name","displayOption");
        parent.layer.close(index);//关闭弹窗
        parent.sendTextAction();//父页面方法
    });
});

</script>

</head>
<body>
    <table width="100%" class="TableBlock">
        <tbody>
            <tr>
                <td colspan="2" style="font-weight: bold; background: #EFEFEF;" height="25">文本信息
                </td>
            </tr>
            <tr>
                <td align="right">信息显示类型
                    :</td>
                <td>
                    <input type="checkbox" id="ckDisplay0" name="displayOption" value="0" checked="true" />紧急
                    <input type="checkbox" id="ckDisplay2" name="displayOption" value="2" checked="true"/>终端显示器显示
                    <input type="checkbox" id="ckDisplay3" name="displayOption" value="3" checked="true"/>终端TTS播读
                    <input type="checkbox" id="ckDisplay4" name="displayOption" value="4" />广告屏显示
                    <!--<input type="checkbox" id="" name="displayOption" value="5" />弗斯特广告屏-->
                </td>
            </tr>
            <tr>
                <td align="right">下发内容:</td>
                <td align="left">
                    <textarea id="textContent" name="textContent" class="required" rows=4 cols=50 onpropertychange="this.style.posHeight=this.scrollHeight "></textarea>
                </td>
            </tr>
            <tr>
                <td colspan=2 align="center">
                    <input id="sendTextCommandBtn" type="submit" class="sendjson" value="发送">
            </tr>
        </tbody>
    </table>
</body>